package com.yuyou.fn.educational.service;

import com.github.wens.framework.service.ISuperService;
import com.github.wens.mybatisplus.plugins.Page;
import com.yuyou.fn.common.util.Principals;
import com.yuyou.fn.educational.entity.StudentReg;
import com.yuyou.fn.educational.vo.*;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author Terry StudentReg 表数据服务层接口
 */
public interface IStudentRegService extends ISuperService<StudentReg, Long> {


    

    List<StudentReg> findStudentRegQuery(StudentRegQueryVo studentRegQueryVo);

    List<StudentRegDetailVo> toStudentRegDetailVo(List<StudentReg> studentRegList);


    List<StudentReg> findStudentRegByCourseOrderId(Long courseOrderId);

     StudentReg findRegByCourseOrderId(long courseOrderId);
    /**
	 *
	 * @param courseOrderId
	 * @param chargingStatus
	 *            支付状态
	 */
    void changeStudentRegCharging(Long courseOrderId, Integer chargingStatus, List<PayLecture> payLectures);


    void changeClass(Long regId, Integer changeLectureFrom, Long classId, Integer startAmount, Integer endAmount,String reason, Principals.Principal principal);

    /**
	 * 修改注册状态
	 */
    void changeRegStatus(Long regId, Integer regStatus);


    Page<StudentReg> findStudentRegByQuery(StudentRegQueryVo studentRegQueryVo, int pageNo, int pageSize);


    List<StudentReg> findStudentReg(Long classId, Long studentId);


    void changeRefundStatus(Long regId, int status);

    void saveStudentReg(List<StudentReg> studentRegList);


    List<StudentReg> findStudentRegByPeriodIdStudentId(Long periodId, Long studentId);


    List<StudentReg> findStudentRegByClassId(Long classId);


    List<StudentReg> findStudentRegByAreaTeamIdPeriodIdStudentIds(Long areaTeamId , Long periodId , List<Long> studentIds);


    /**
	 * 取消报名
	 *
	 * @param regId
	 */
    void cancel(Long regId );

    Long countByPeriodIdStudentIdRegStatus(Long periodId,Long studentId , Integer regStatus );

    Long countPrevious(List<Long> periodIds, Long studentId, Long areaTeamId, Integer regStatus);

    List<StudentReg> findByPeriods(List<Long> periodIds, Long studentId, Integer regStatus);

    void updateSenior(List<Long> classIds,Long seniorId,String seniorName);

    void updateSeniorByRegId(Long regId,Long seniorId);

    void updateRefundStatus(Long regId,Integer refundStatus);

    List<StudentHistoryRegInfoVo> findStudentHistoryRegInfo(Long studentId, List<Long> relPeriodIdList);

    void refundAndCancel(Long regId, Principals.Principal principal);


    void setupSetupCounselor(Long courseOrderId, Long counselorId );

    List<Long> findRegStudentIds(Long areaTeamId ,Long subjectId , List<Long> periodIds, List<Long> gradeIds, List<Integer> levels, List<Long> campusIds);


    List<StudentReg> findListByClassIds(List<Long> classIds, Integer regStatus,String ...columns);

    List<StudentReg> findByClassIdsStudentIds(List<Long> classIds,List<Long> studentIds);

    List<StudentReg> findRegByClassIdStudentId(long classId,long studentId,List<Integer> regStatuses);


    Long countBySeniorStudentRegs(Long seniorId,Long studentId,Long periodId,Long busTeamId);


    List<StudentClassVo> findStudentClassList(List<Long> studentIds,List<Long> classIds);

    List<StudentReg> findByCourseOrderIds(List<Long> courseOrderIds,String ...columns);

    boolean hadReg(Long studentId, Long classId, int startLecture, int endLecture);

    boolean hadReg(List<StudentReg> studentRegList , Integer startLecture , Integer endLecture  );


    /**
    *@Description: 通过班级ids 学生id 查询在读记录
    *@Param:
    *@return:
    *@Author: lzh
    *@date:
    */
    List<StudentReg> findReadListByClassIdsStudentId(List<Long> classIds,Long studentId);

    List<StudentReg> findRegListByStudentIdsPeriodIdsRegStatuses(List<Long> studentIds,List<Long> periodIds,List<Integer> regStatuses,String ...columns);


}